/**
 *****************************************************************************
 * @file
 * @brief
 * @author taoye
 * @version V0.0.1
 * @date 2021/08/24
 ****************************************************************************
 */
#ifndef DRV_GPIOEXIT_H
#define DRV_GPIOEXIT_H

#include "drv_include.h"
#include "drv_f4_gpio.h"

/* private config -----------------------------------------------------------*/
typedef struct
{
    EXTI_InitTypeDef    exit;
    drv_gpio_t 		    exit_io;
}gpioexit_private_t;

/* Public defines -----------------------------------------------------------*/
typedef struct  drv_gpioexit            drv_gpioexit_t;

/* Public enum    -----------------------------------------------------------*/
typedef enum
{
    rising,
    falling,
    rising_falling,
}exit_trigger_e;

/* Public Struct  -----------------------------------------------------------*/
struct drv_gpioexit
{
    /* ***************Public Parameter  *************** */
    const char *        PIN;
    gpio_mode_e         MODE;
    void                (*callback)(void);
    exit_trigger_e      trigger;
    uint8_t             PreempPriority;                 //中断优先级

    /* ***************Public Method     *************** */
    void    (* Set)     (drv_gpioexit_t *, uint8_t);    //外部中断开关
    uint8_t (* Read)    (drv_gpioexit_t *);             //外部中断引脚读取

    /* ***************Private Attributes*************** */
    gpioexit_private_t  private;
};


/* Public Variable  ---------------------------------------------------------*/
//Pointer

//Array

//Const

/* Pubilc function prototypes -----------------------------------------------*/
int Drv_GpioExit_Init(drv_gpioexit_t *this);


#endif

